<template>
	<view class="content">
		<image class="logo" src="/static/logo.png"></image>
		<view class="text-area">
			<text class="title">{{title}}</text>
			<view class="title">{{word}}</view>
		</view>
		<view class="count" @click="changeCount" >
			count -- {{count }}
		</view>
		<view class="item" v-for="(l,i) in list" :key="i">
			{{l}}
		</view>
		<button @click="gotohome">点击跳转首页 </button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: 'Hello',
				word:"ARe you OK",
				count:1000,
				list:['Vue',"Node","React"]
			}
		},
		mounted(){
			this.quest("https://m.maizuo.com/gateway",'get',{
				cityId: 110100,
				pageNum: 1,
				pageSize: 10,
				type: 1,
			},{
				'X-Host': 'mall.film-ticket.film.list'
			})
			.then(res=>{

			})
		},
		onLoad() {
			this.getUsers()
		},
		onShow(){

		},
		methods: {
			gotohome(){
				// uni.navigateTo({
				// 	url:'../home/home'
				// })
				uni.switchTab({
					url:'../home/home'
				})
			},
			changeCount(){
				this.count++;
			},
			getUsers(){
				// bug   版本太低了 
				wx.cloud.database().collection("wh2114_users")
				.where({})
				.get()
				.then(res=>{
					console.log(res)
					uni.showToast({title:"请求成功user"})
				})
			},
		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
</style>